/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Vista;

import Modelo.Clases.*;
import Modelo.Modelo;
import java.awt.Color;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.List;
import javax.swing.JOptionPane;

/**
 *
 * @author cltsmalc
 */
public class SolicitudJPanel extends javax.swing.JPanel {

    /**
     * Creates new form SolicitudJPanel
     */
    
    private  boolean seSeleccionoHora = false ;
    private  int hora = 0 ;
    private  int minutos = 0 ;
    private Color colorDefault ; 
    private Color colorSelected ; 
    
      List<VideoConferencia> lista ;
      
    public static Anciano anciano = new Anciano();
    public static Familiar familiar = new Familiar();
    public static Amigo amigo = new Amigo();
              
    public SolicitudJPanel() {
        initComponents();
    }
    
     public SolicitudJPanel(int width , int height) {
        initComponents();
        this.setSize(width, height);
        this.setVisible(true);
        colorSelected = Color.orange;
        
         lista = Modelo.consultarVideoConferencias();
        SolicitudJPanel.anciano = new  Anciano() ;
                 SolicitudJPanel.familiar = new Familiar() ;
                  SolicitudJPanel.amigo = new Amigo();
                   seSeleccionoHora = false ;
     hora = 0 ;
    minutos = 0 ;
    
        
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jEImagePanel1 = new recursos.JEImagePanel();
        jCalendar1 = new com.toedter.calendar.JCalendar();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();
        jButton5 = new javax.swing.JButton();
        jButton6 = new javax.swing.JButton();
        jButton7 = new javax.swing.JButton();
        jButton8 = new javax.swing.JButton();
        jButton9 = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jButton10 = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        jButton11 = new javax.swing.JButton();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jButton13 = new javax.swing.JButton();

        jEImagePanel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/recursos/magic-wind-blue.jpg"))); // NOI18N
        jEImagePanel1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jEImagePanel1MouseExited(evt);
            }
        });

        jCalendar1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jCalendar1MouseExited(evt);
            }
        });

        jButton1.setText("ok");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton2.setText("11:00-11:30");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jButton3.setText("11:30-12:00");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jButton4.setText("12:00-12:30");
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        jButton5.setText("12:30-13:00");
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });

        jButton6.setText("15:30-16:00");
        jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton6ActionPerformed(evt);
            }
        });

        jButton7.setText("15:00-15:30");
        jButton7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton7ActionPerformed(evt);
            }
        });

        jButton8.setText("14:30-15:00");
        jButton8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton8ActionPerformed(evt);
            }
        });

        jButton9.setText("14:00-14:30");
        jButton9.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton9ActionPerformed(evt);
            }
        });

        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel2.setText("Hora");

        jLabel3.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLabel3.setText("Dia");

        jButton10.setText("Cancelar");
        jButton10.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton10ActionPerformed(evt);
            }
        });

        jButton11.setText("Seleccionar Anciano");
        jButton11.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton11ActionPerformed(evt);
            }
        });

        jButton13.setText("Ver Todas");
        jButton13.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton13ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jEImagePanel1Layout = new javax.swing.GroupLayout(jEImagePanel1);
        jEImagePanel1.setLayout(jEImagePanel1Layout);
        jEImagePanel1Layout.setHorizontalGroup(
            jEImagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jEImagePanel1Layout.createSequentialGroup()
                .addGroup(jEImagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jEImagePanel1Layout.createSequentialGroup()
                        .addGap(67, 67, 67)
                        .addGroup(jEImagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(jEImagePanel1Layout.createSequentialGroup()
                                .addComponent(jButton11)
                                .addGap(55, 55, 55)
                                .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 164, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jEImagePanel1Layout.createSequentialGroup()
                                .addComponent(jButton13, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(15, 15, 15))))
                    .addGroup(jEImagePanel1Layout.createSequentialGroup()
                        .addGap(313, 313, 313)
                        .addComponent(jLabel3)))
                .addContainerGap(339, Short.MAX_VALUE))
            .addGroup(jEImagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jEImagePanel1Layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(jEImagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jEImagePanel1Layout.createSequentialGroup()
                            .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 700, Short.MAX_VALUE)
                            .addComponent(jButton10, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(jEImagePanel1Layout.createSequentialGroup()
                            .addGap(78, 78, 78)
                            .addGroup(jEImagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(jEImagePanel1Layout.createSequentialGroup()
                                    .addComponent(jCalendar1, javax.swing.GroupLayout.PREFERRED_SIZE, 504, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 140, Short.MAX_VALUE)
                                    .addGroup(jEImagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGroup(jEImagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jButton3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jButton4, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jButton5, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jButton9, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jButton8, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jButton7, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jButton6, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                    .addGap(76, 76, 76))
                                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jEImagePanel1Layout.createSequentialGroup()
                                    .addComponent(jLabel2)
                                    .addGap(120, 120, 120))
                                .addGroup(jEImagePanel1Layout.createSequentialGroup()
                                    .addGap(30, 30, 30)
                                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 467, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 269, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                    .addContainerGap()))
        );
        jEImagePanel1Layout.setVerticalGroup(
            jEImagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jEImagePanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jEImagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jButton11)
                    .addGroup(jEImagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jEImagePanel1Layout.createSequentialGroup()
                            .addGap(4, 4, 4)
                            .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(18, 18, 18)
                .addComponent(jLabel3)
                .addGap(448, 448, 448)
                .addComponent(jButton13, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
            .addGroup(jEImagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jEImagePanel1Layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jLabel1)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 57, Short.MAX_VALUE)
                    .addComponent(jLabel2)
                    .addGap(18, 18, 18)
                    .addGroup(jEImagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jCalendar1, javax.swing.GroupLayout.PREFERRED_SIZE, 390, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGroup(jEImagePanel1Layout.createSequentialGroup()
                            .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jButton9, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jButton8, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jButton7, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGap(42, 42, 42)
                    .addGroup(jEImagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jButton10, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap()))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jEImagePanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jEImagePanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 581, Short.MAX_VALUE)
        );
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:

        Calendar d = jCalendar1.getCalendar();
        Calendar dd ;
        try{
        if (seSeleccionoHora) {
            dd = new GregorianCalendar(d.get(Calendar.YEAR), d.get(Calendar.MONTH), d.get(Calendar.DAY_OF_MONTH), hora, minutos, 0);
            Calendar actual = new GregorianCalendar();
            if(dd.getTime().compareTo(actual.getTime()) > 0) {
            if(estaDisponible(dd)){
                if(SolicitudJPanel.anciano.getCedula() != null && (SolicitudJPanel.familiar.getCedula() != null || SolicitudJPanel.amigo.getCedula() != null )){
                    if(SolicitudJPanel.familiar.getCedula() != null){
                        VideoConferencia v = new VideoConferencia(SolicitudJPanel.anciano.getIdAnciano(), SolicitudJPanel.familiar.getIdFamiliar(),null,
                        dd.getTime(), null, "h", 0, dd.getTime());
                        System.out.println(SolicitudJPanel.familiar.getIdFamiliar());
                         Modelo.guardar(v);
                        SolicitudJPanel.anciano = new  Anciano() ;
                        SolicitudJPanel.familiar = new Familiar() ;
                        SolicitudJPanel.amigo = new Amigo();
                        SeleccionarAncianoJFrame.cedulaAnciano = "";
                        this.jLabel4.setText("");
                        this.jLabel5.setText("");
                    }
                         if(SolicitudJPanel.amigo.getCedula() != null){
                         VideoConferencia v = new VideoConferencia(SolicitudJPanel.anciano.getIdAnciano(), null,SolicitudJPanel.amigo.getIdAmigo(),
                           dd.getTime(), null, "h", 0, dd.getTime());
                         System.out.println(SolicitudJPanel.amigo.getIdAmigo());
                         Modelo.guardar(v);
                         SolicitudJPanel.anciano = new  Anciano() ;
                         SolicitudJPanel.familiar = new Familiar() ;
                         SolicitudJPanel.amigo = new Amigo();
                         SeleccionarAncianoJFrame.cedulaAnciano = "";
                         this.jLabel4.setText("");
                         this.jLabel5.setText("");
                    }
                       JOptionPane.showMessageDialog(null,"Videoconferencia reservada correctamente");
                }else{
                JOptionPane.showMessageDialog(null,"Seleccione el Familiar y el Anciano");
                }
            }else{
            JOptionPane.showMessageDialog(null,"El horario no esta disponible");
            }
        }else{
                JOptionPane.showMessageDialog(null,"La Fecha ya paso");
            }
        } else {
            JOptionPane.showMessageDialog(null,"Seleccione una hora");
        }
    }catch(Exception e ){
        e.printStackTrace();
     JOptionPane.showMessageDialog(null,"Seleccione la fecha y los miembros de la videoconferencia");
    }

 
           
    }//GEN-LAST:event_jButton1ActionPerformed

    public boolean  estaDisponible( Calendar c ){
        
        
        List<VideoConferencia> lista = Modelo.consultarVideoConferencias();
        
        for(int i = 0 ; i < lista.size() ; i++){
        
            Calendar cc = new GregorianCalendar();
            
            cc.setTime(lista.get(i).getFecha());
            
            if(cc.get(Calendar.DAY_OF_MONTH)==c.get(Calendar.DAY_OF_MONTH) && cc.get(Calendar.YEAR)== c.get(Calendar.YEAR) && cc.get(Calendar.MONTH) == c.get(Calendar.MONTH)
                    && lista.get(i).getHoraInicio().getHours() == c.get(Calendar.HOUR_OF_DAY) &&lista.get(i).getHoraInicio().getMinutes() == c.get(Calendar.MINUTE)){
            return false ;
            }
            
        }
        
        return true ;
        
    }
    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        // TODO add your handling code here:

        seSeleccionoHora = true;
        this.hora = 11;
        this.minutos = 0;


        
        this.jButton2.setBackground(colorSelected);
        this.jButton3.setBackground(colorDefault);
        this.jButton4.setBackground(colorDefault);
        this.jButton5.setBackground(colorDefault);
        this.jButton6.setBackground(colorDefault);
        this.jButton7.setBackground(colorDefault);
        this.jButton8.setBackground(colorDefault);
        this.jButton9.setBackground(colorDefault);




    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        // TODO add your handling code here:
        seSeleccionoHora = true;
        this.hora = 11;
        this.minutos = 30;

        this.jButton3.setBackground(colorSelected);
        this.jButton2.setBackground(colorDefault);
        this.jButton4.setBackground(colorDefault);
        this.jButton5.setBackground(colorDefault);
        this.jButton6.setBackground(colorDefault);
        this.jButton7.setBackground(colorDefault);
        this.jButton8.setBackground(colorDefault);
        this.jButton9.setBackground(colorDefault);

    }//GEN-LAST:event_jButton3ActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
        // TODO add your handling code here:
        seSeleccionoHora = true;
        this.hora = 12;
        this.minutos = 0;
        this.jButton4.setBackground(colorSelected);
        this.jButton3.setBackground(colorDefault);
        this.jButton2.setBackground(colorDefault);
        this.jButton5.setBackground(colorDefault);
        this.jButton6.setBackground(colorDefault);
        this.jButton7.setBackground(colorDefault);
        this.jButton8.setBackground(colorDefault);
        this.jButton9.setBackground(colorDefault);
    }//GEN-LAST:event_jButton4ActionPerformed

    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
        // TODO add your handling code here:
        seSeleccionoHora = true;
        this.hora = 12;
        this.minutos = 30;
        this.jButton5.setBackground(colorSelected);
        this.jButton3.setBackground(colorDefault);
        this.jButton4.setBackground(colorDefault);
        this.jButton2.setBackground(colorDefault);
        this.jButton6.setBackground(colorDefault);
        this.jButton7.setBackground(colorDefault);
        this.jButton8.setBackground(colorDefault);
        this.jButton9.setBackground(colorDefault);
    }//GEN-LAST:event_jButton5ActionPerformed

    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
        // TODO add your handling code here:
        seSeleccionoHora = true;
        this.hora = 15;
        this.minutos = 30;
        this.jButton6.setBackground(colorSelected);
        this.jButton3.setBackground(colorDefault);
        this.jButton4.setBackground(colorDefault);
        this.jButton5.setBackground(colorDefault);
        this.jButton2.setBackground(colorDefault);
        this.jButton7.setBackground(colorDefault);
        this.jButton8.setBackground(colorDefault);
        this.jButton9.setBackground(colorDefault);
    }//GEN-LAST:event_jButton6ActionPerformed

    private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed
        // TODO add your handling code here:
        seSeleccionoHora = true;
        this.hora = 15;
        this.minutos = 0;
        this.jButton7.setBackground(colorSelected);
        this.jButton3.setBackground(colorDefault);
        this.jButton4.setBackground(colorDefault);
        this.jButton5.setBackground(colorDefault);
        this.jButton6.setBackground(colorDefault);
        this.jButton2.setBackground(colorDefault);
        this.jButton8.setBackground(colorDefault);
        this.jButton9.setBackground(colorDefault);
    }//GEN-LAST:event_jButton7ActionPerformed

    private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton8ActionPerformed
        // TODO add your handling code here:
        seSeleccionoHora = true;
        this.hora = 14;
        this.minutos = 30;
        this.jButton8.setBackground(colorSelected);
        this.jButton3.setBackground(colorDefault);
        this.jButton4.setBackground(colorDefault);
        this.jButton5.setBackground(colorDefault);
        this.jButton6.setBackground(colorDefault);
        this.jButton7.setBackground(colorDefault);
        this.jButton2.setBackground(colorDefault);
        this.jButton9.setBackground(colorDefault);
    }//GEN-LAST:event_jButton8ActionPerformed

    private void jButton9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton9ActionPerformed
        // TODO add your handling code here:
        seSeleccionoHora = true;
        this.hora = 14;
        this.minutos = 0;
        this.jButton9.setBackground(colorSelected);
        this.jButton3.setBackground(colorDefault);
        this.jButton4.setBackground(colorDefault);
        this.jButton5.setBackground(colorDefault);
        this.jButton6.setBackground(colorDefault);
        this.jButton7.setBackground(colorDefault);
        this.jButton8.setBackground(colorDefault);
        this.jButton2.setBackground(colorDefault);
    }//GEN-LAST:event_jButton9ActionPerformed

    private void jButton10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton10ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton10ActionPerformed

private void jButton11ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton11ActionPerformed
// TODO add your handling code here:
    
    SeleccionarAncianoJFrame sa = new SeleccionarAncianoJFrame();
    sa.setVisible(true);
    
}//GEN-LAST:event_jButton11ActionPerformed

private void jEImagePanel1MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jEImagePanel1MouseExited
// TODO add your handling code here:
    if(SolicitudJPanel.anciano.getNombre() != null ){
    
    jLabel4.setText(SolicitudJPanel.anciano.getNombre() + " " +SolicitudJPanel.anciano.getApellido());
    }
       if(SolicitudJPanel.familiar.getNombre() != null ){
    jLabel5.setText(SolicitudJPanel.familiar.getNombre() + " " +SolicitudJPanel.familiar.getApellido());
       }
}//GEN-LAST:event_jEImagePanel1MouseExited

private void jCalendar1MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jCalendar1MouseExited
// TODO add your handling code here:
     if(SolicitudJPanel.anciano.getNombre() != null ){
    
    jLabel4.setText(SolicitudJPanel.anciano.getNombre() + " " +SolicitudJPanel.anciano.getApellido());
    }
       if(SolicitudJPanel.familiar.getNombre() != null ){
    jLabel5.setText(SolicitudJPanel.familiar.getNombre() + " " +SolicitudJPanel.familiar.getApellido());
       }
    
}//GEN-LAST:event_jCalendar1MouseExited

private void jButton13ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton13ActionPerformed

    VideoconferenciasJFrame v = new VideoconferenciasJFrame();
    v.setVisible(true);
    
    
}//GEN-LAST:event_jButton13ActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton10;
    private javax.swing.JButton jButton11;
    private javax.swing.JButton jButton13;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton6;
    private javax.swing.JButton jButton7;
    private javax.swing.JButton jButton8;
    private javax.swing.JButton jButton9;
    private com.toedter.calendar.JCalendar jCalendar1;
    private recursos.JEImagePanel jEImagePanel1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    // End of variables declaration//GEN-END:variables
}
